﻿<UserControl x:Class="openPDC.UI.UserControls.OutputStreamUserControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:sys="clr-namespace:System;assembly=mscorlib"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" d:DesignHeight="650" d:DesignWidth="850"
             xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:uc="clr-namespace:GSF.TimeSeries.UI.UserControls;assembly=GSF.TimeSeries.UI.WPF"
             xmlns:tsfBinding="clr-namespace:GSF.TimeSeries.UI.Binding;assembly=GSF.TimeSeries.UI"
             Background="Transparent">

    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/GSF.TimeSeries.UI.WPF;Component/Resources/CommonResource.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>    
    
    <StackPanel Orientation="Vertical">
        
        <StackPanel.Resources>
            <CollectionViewSource Source="{Binding Path=NodeLookupList}" x:Key="NodeLookupList"/>
            <CollectionViewSource Source="{Binding Path=TypeLookupList}" x:Key="TypeLookupList"/>
            <CollectionViewSource Source="{Binding Path=DownSamplingMethodLookupList}" x:Key="DownSamplingMethodLookupList"/>
            <CollectionViewSource Source="{Binding Path=DataFormatLookupList}" x:Key="DataFormatLookupList"/>
            <CollectionViewSource Source="{Binding Path=CoordinateFormatLookupList}" x:Key="CoordinateFormatLookupList"/>
            <CollectionViewSource Source="{Binding Path=MirroringSourceLookupList}" x:Key="MirroringSourceLookupList"/>
           
        </StackPanel.Resources>
        
        <ScrollViewer Height="360">
        
            <Grid x:Name="GridDetailView" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="5" DataContext="{tsfBinding:Column Path=CurrentItem}" DataContextChanged="GridDetailView_DataContextChanged">
            
            <Grid.BindingGroup >
                <BindingGroup Name="input"/>
            </Grid.BindingGroup>
            
            <Grid.RowDefinitions>
                <RowDefinition Height="*" />
                <RowDefinition Height="*" />
                <RowDefinition Height="*" />
                <RowDefinition Height="*" />
                <RowDefinition Height="*" />
                <RowDefinition Height="*" />
                <RowDefinition Height="*" />
                <RowDefinition Height="*" />
                <RowDefinition Height="*" />                
            </Grid.RowDefinitions>
            
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="2*" />
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="2*" />
            </Grid.ColumnDefinitions>

            <StackPanel Orientation="Horizontal" Grid.Row="0" Grid.Column="0" HorizontalAlignment="Right">
                <TextBlock Text="Acronym" Style="{StaticResource RequiredLabel}" />
                <TextBlock Style="{StaticResource RequiredMarker}" />
            </StackPanel>            
            <TextBox Grid.Row="0" Grid.Column="1" Text="{tsfBinding:Column Path=Acronym}" MaxLength="200" CharacterCasing="Upper"/>
                        
            <TextBlock Grid.Row="0" Grid.Column="2" Text="Name" />
            <TextBox Grid.Row="0" Grid.Column="3" Text="{tsfBinding:Column Path=Name}" MaxLength="200"/>

            <StackPanel Orientation="Horizontal" Grid.Row="1" Grid.Column="0" HorizontalAlignment="Right">
                <TextBlock Text="ID Code" Style="{StaticResource RequiredLabel}"/>
                <TextBlock Style="{StaticResource RequiredMarker}" />
            </StackPanel>
                <TextBox Grid.Row="1" Grid.Column="1" Text="{tsfBinding:Column Path=IDCode}" Width="{StaticResource XXSmallItemSize}"/>
            <TextBlock Grid.Row="1" Grid.Column="2" Text="Type" />
            <ComboBox Grid.Row="1" Grid.Column="3" ItemsSource="{Binding Source={StaticResource TypeLookupList}}" DisplayMemberPath="Value" 
                      SelectedItem="{tsfBinding:Column Path=Type, Converter={StaticResource DictionaryToKeyValuePairConverter}, ConverterParameter={StaticResource TypeLookupList}}"/>
            
            <TextBlock Grid.Row="2" Grid.Column="0" Text="Connection String" />
            <TextBox Grid.Row="2" Grid.Column="1" Text="{tsfBinding:Column Path=ConnectionString}" />
            
            <TextBlock Grid.Row="3" Grid.Column="0" Text="TCP Channel" VerticalAlignment="Top"/>
            <StackPanel Orientation="Horizontal" Grid.Row="3" Grid.Column="1" VerticalAlignment="Top">
                <TextBox Text="{tsfBinding:Column Path=CommandChannel}" Height="{StaticResource XSmallItemSize}" TextWrapping="Wrap" VerticalScrollBarVisibility="Auto"/>
                    <Button ToolTipService.ToolTip="Build Command Channel String" Width="Auto" VerticalAlignment="Top"
                        Command="{Binding Path=DataContext.BuildCommandChannelCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}}">
                        <Button.Template>
                            <ControlTemplate>
                                <Image Source="/GSF.TimeSeries.UI;component/images/Plus.png" Height="24" Width="24" />
                            </ControlTemplate>
                        </Button.Template>
                    </Button>
                </StackPanel>
            <TextBlock Grid.Row="3" Grid.Column="2" Text="UDP Channel"  VerticalAlignment="Top"/>
            <StackPanel Orientation="Horizontal" Grid.Row="3" Grid.Column="3" VerticalAlignment="Top">
                    <TextBox Text="{tsfBinding:Column Path=DataChannel}" Height="{StaticResource XSmallItemSize}" TextWrapping="Wrap" VerticalScrollBarVisibility="Auto"/>
                    <Button Content=" + " ToolTipService.ToolTip="Build Data Channel String" Width="Auto" VerticalAlignment="Top"
                        Command="{Binding Path=DataContext.BuildDataChannelCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}}">
                        <Button.Template>
                            <ControlTemplate>
                                <Image Source="/GSF.TimeSeries.UI;component/images/Plus.png" Height="24" Width="24" />
                            </ControlTemplate>
                        </Button.Template>
                    </Button>
                </StackPanel>
            
            <StackPanel Orientation="Horizontal" Grid.Row="4" Grid.Column="0" HorizontalAlignment="Right">
                <TextBlock Text="Nominal Frequency" Style="{StaticResource RequiredLabel}" />
                <TextBlock Style="{StaticResource RequiredMarker}" />
            </StackPanel>
                <TextBox Grid.Row="4" Grid.Column="1" Text="{tsfBinding:Column Path=NominalFrequency}" Width="35" />
            <StackPanel Orientation="Horizontal" Grid.Row="4" Grid.Column="2">
                <TextBlock Text="Frames Per Second" Style="{StaticResource RequiredLabel}"/>
                <TextBlock Style="{StaticResource RequiredMarker}"/>
            </StackPanel>
                <TextBox Grid.Row="4" Grid.Column="3" Text="{tsfBinding:Column Path=FramesPerSecond}" Width="35" />
            
            <StackPanel Orientation="Horizontal" Grid.Row="5" Grid.Column="0" HorizontalAlignment="Right">
                <TextBlock Text="Lag Time" Style="{StaticResource RequiredLabel}"/>
                <Button Content="?" Margin="2,0,0,0" Template="{StaticResource RoundButtonTemplate}" Background="{StaticResource BlueRadialGradientBrush}" Foreground="#FFFFFF" Width="16" Height="16" FontWeight="Bold" FontSize="{StaticResource SmallTextSize}"
                        Tag="HMC - Lag Time.png" ToolTipService.ToolTip="Click here for help on Lag Time" Click="ButtonHelp_Click"/>
                <TextBlock Style="{StaticResource RequiredMarker}"/>
            </StackPanel>
            <TextBox Grid.Row="5" Grid.Column="1" Text="{tsfBinding:Column Path=LagTime}" Width="{StaticResource XSmallItemSize}" />
            <StackPanel Orientation="Horizontal" Grid.Row="5" Grid.Column="2" HorizontalAlignment="Right">
                <TextBlock Text="Lead Time" Style="{StaticResource RequiredLabel}"/>
                    <Button Content="?" Margin="2,0,0,0" Template="{StaticResource RoundButtonTemplate}" Background="{StaticResource BlueRadialGradientBrush}" Foreground="#FFFFFF" Width="16" Height="16" FontWeight="Bold" FontSize="{StaticResource SmallTextSize}"
                        Tag="HMC - Lead Time.png" ToolTipService.ToolTip="Click here for help on Lead Time" Click="ButtonHelp_Click"/>
                <TextBlock Style="{StaticResource RequiredMarker}"/>
            </StackPanel>
            <TextBox Grid.Row="5" Grid.Column="3" Text="{tsfBinding:Column Path=LeadTime}" Width="{StaticResource XSmallItemSize}" />

            <Expander Header="Advanced Properties" Grid.Row="6" Grid.ColumnSpan="4" Margin="0">
                
                <Grid>

                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="2*" />
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="2*" />
                    </Grid.ColumnDefinitions>
                    
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>

                    <StackPanel Orientation="Horizontal" Grid.Row="0" Grid.Column="0" HorizontalAlignment="Right">
                        <TextBlock Text="Time Resolution" Style="{StaticResource RequiredLabel}"/>
                            <Button Content="?" Margin="2,0,0,0" Template="{StaticResource RoundButtonTemplate}" Background="{StaticResource BlueRadialGradientBrush}" Foreground="#FFFFFF" Width="16" Height="16" FontWeight="Bold" FontSize="{StaticResource SmallTextSize}"
                                Tag="HMC - Time Resolution.png" ToolTipService.ToolTip="Click here for help on Time Resolution" Click="ButtonHelp_Click"/>
                        <TextBlock Style="{StaticResource RequiredMarker}"/>
                    </StackPanel>
                    <TextBox Grid.Row="0" Grid.Column="1" Text="{tsfBinding:Column Path=TimeResolution}" Width="{StaticResource XSmallItemSize}" />
                    <StackPanel Orientation="Horizontal" Grid.Row="0" Grid.Column="2" HorizontalAlignment="Right">
                        <TextBlock Text="Downsampling" Style="{StaticResource RequiredLabel}"/>
                            <Button Content="?" Margin="2,0,0,0" Template="{StaticResource RoundButtonTemplate}" Background="{StaticResource BlueRadialGradientBrush}" Foreground="#FFFFFF" Width="16" Height="16" FontWeight="Bold" FontSize="{StaticResource SmallTextSize}"
                                Tag="HMC - Downsampling Method.png" ToolTipService.ToolTip="Click here for help on Downsampling Method" Click="ButtonHelp_Click"/>
                        <TextBlock Style="{StaticResource RequiredMarker}"/>
                    </StackPanel>
                    <ComboBox Grid.Row="0" Grid.Column="3" ItemsSource="{Binding Source={StaticResource DownSamplingMethodLookupList}}" DisplayMemberPath="Value"
                      SelectedItem="{tsfBinding:Column Path=DownSamplingMethod, Converter={StaticResource DictionaryToKeyValuePairConverter}, ConverterParameter={StaticResource DownSamplingMethodLookupList}}"/>

                    <StackPanel Orientation="Horizontal" Grid.Row="1" Grid.Column="0" HorizontalAlignment="Right">
                        <TextBlock Text="Data Format" Style="{StaticResource RequiredLabel}"/>
                        <TextBlock Style="{StaticResource RequiredMarker}"/>
                    </StackPanel>
                    <ComboBox Grid.Row="1" Grid.Column="1" ItemsSource="{Binding Source={StaticResource DataFormatLookupList}}" DisplayMemberPath="Value"
                      SelectedItem="{tsfBinding:Column Path=DataFormat, Converter={StaticResource DictionaryToKeyValuePairConverter}, ConverterParameter={StaticResource DataFormatLookupList}}"/>
                    <StackPanel Orientation="Horizontal" Grid.Row="1" Grid.Column="2" HorizontalAlignment="Right">
                        <TextBlock Text="Coordinate Format" Style="{StaticResource RequiredLabel}"/>
                        <TextBlock Style="{StaticResource RequiredMarker}"/>
                    </StackPanel>
                    <ComboBox Grid.Row="1" Grid.Column="3" ItemsSource="{Binding Source={StaticResource CoordinateFormatLookupList}}" DisplayMemberPath="Value"
                      SelectedItem="{tsfBinding:Column Path=CoordinateFormat, Converter={StaticResource DictionaryToKeyValuePairConverter}, ConverterParameter={StaticResource CoordinateFormatLookupList}}"/>

                    <StackPanel Orientation="Horizontal" Grid.Row="2" Grid.Column="0" HorizontalAlignment="Right">
                        <TextBlock Text="Current Scaling Value" Style="{StaticResource RequiredLabel}"/>
                        <TextBlock Style="{StaticResource RequiredMarker}"/>
                    </StackPanel>
                    <TextBox Grid.Row="2" Grid.Column="1" Text="{tsfBinding:Column Path=CurrentScalingValue}" Width="{StaticResource XSmallItemSize}"/>
                    <StackPanel Orientation="Horizontal" Grid.Row="2" Grid.Column="2">
                        <TextBlock Text="Voltage Scaling Value" Style="{StaticResource RequiredLabel}"/>
                        <TextBlock Style="{StaticResource RequiredMarker}"/>
                    </StackPanel>
                    <TextBox Grid.Row="2" Grid.Column="3" Text="{tsfBinding:Column Path=VoltageScalingValue}" Width="{StaticResource XSmallItemSize}" />

                    <StackPanel Orientation="Horizontal" Grid.Row="3" Grid.Column="0" HorizontalAlignment="Right">
                        <TextBlock Text="Analog Scaling Value" Style="{StaticResource RequiredLabel}"/>
                        <TextBlock Style="{StaticResource RequiredMarker}"/>
                    </StackPanel>
                    <TextBox Grid.Row="3" Grid.Column="1" Text="{tsfBinding:Column Path=AnalogScalingValue}" Width="{StaticResource XSmallItemSize}"/>
                    <StackPanel Orientation="Horizontal" Grid.Row="3" Grid.Column="2" HorizontalAlignment="Right">
                        <TextBlock Text="Digital Mask Value" Style="{StaticResource RequiredLabel}"/>
                        <TextBlock Style="{StaticResource RequiredMarker}"  />
                    </StackPanel>
                    <TextBox Grid.Row="3" Grid.Column="3" Text="{tsfBinding:Column Path=DigitalMaskValue}" Width="{StaticResource XSmallItemSize}"/>

                    <StackPanel Orientation="Horizontal" Grid.Row="4" Grid.Column="1">
                        <CheckBox Content="Auto Start Data Channel" IsChecked="{tsfBinding:Column Path=AutoStartDataChannel}" />
                            <Button Content="?" Margin="2,0,0,0" Template="{StaticResource RoundButtonTemplate}" Background="{StaticResource BlueRadialGradientBrush}" Foreground="#FFFFFF" Width="16" Height="16" FontWeight="Bold" FontSize="{StaticResource SmallTextSize}"
                                Tag="HMC - Auto Start Data Channel.png" ToolTipService.ToolTip="Click here for help on Auto Start Data Channel" Click="ButtonHelp_Click"/>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal" Grid.Row="4" Grid.Column="3">
                        <CheckBox Content="Auto Publish Config Frame" IsChecked="{tsfBinding:Column Path=AutoPublishConfigFrame}" />
                            <Button Content="?" Margin="2,0,0,0" Template="{StaticResource RoundButtonTemplate}" Background="{StaticResource BlueRadialGradientBrush}" Foreground="#FFFFFF" Width="16" Height="16" FontWeight="Bold" FontSize="{StaticResource SmallTextSize}"
                                Tag="HMC - Auto Publish Config Frame.png" ToolTipService.ToolTip="Click here for help on Auto Publish Config Frame" Click="ButtonHelp_Click"/>
                    </StackPanel>

                    <StackPanel Orientation="Horizontal" Grid.Row="5" Grid.Column="1">
                        <CheckBox Content="Allow Sorts By Arrival" IsChecked="{tsfBinding:Column Path=AllowSortsByArrival}"/>
                            <Button Content="?" Margin="2,0,0,0" Template="{StaticResource RoundButtonTemplate}" Background="{StaticResource BlueRadialGradientBrush}" Foreground="#FFFFFF" Width="16" Height="16" FontWeight="Bold" FontSize="{StaticResource SmallTextSize}"
                                Tag="HMC - Allow Sorts By Arrival.png" ToolTipService.ToolTip="Click here for help on Allow Sorts By Arrival" Click="ButtonHelp_Click"/>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal" Grid.Row="5" Grid.Column="3">
                        <CheckBox Content="Use Local Clock As Real-time" IsChecked="{tsfBinding:Column Path=UseLocalClockAsRealTime}" />
                            <Button Content="?" Margin="2,0,0,0" Template="{StaticResource RoundButtonTemplate}" Background="{StaticResource BlueRadialGradientBrush}" Foreground="#FFFFFF" Width="16" Height="16" FontWeight="Bold" FontSize="{StaticResource SmallTextSize}"
                                Tag="HMC - Use Local Clock as RealTime.png" ToolTipService.ToolTip="Click here for help on Use Local Clock As Real-time" Click="ButtonHelp_Click"/>
                    </StackPanel>

                    <StackPanel Orientation="Horizontal" Grid.Row="6" Grid.Column="1">
                        <CheckBox Content="Allow Preemptive Publishing" IsChecked="{tsfBinding:Column Path=AllowPreemptivePublishing}"/>
                            <Button Content="?" Margin="2,0,0,0" Template="{StaticResource RoundButtonTemplate}" Background="{StaticResource BlueRadialGradientBrush}" Foreground="#FFFFFF" Width="16" Height="16" FontWeight="Bold" FontSize="{StaticResource SmallTextSize}"
                                Tag="HMC - Allow Preemptive Publishing.png" ToolTipService.ToolTip="Click here for help on Allow Preemptive Publishing" Click="ButtonHelp_Click"/>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal" Grid.Row="6" Grid.Column="3">
                        <CheckBox Content="Ignore Bad Timestamps" IsChecked="{tsfBinding:Column Path=IgnoreBadTimeStamps}"/>
                            <Button Content="?" Margin="2,0,0,0" Template="{StaticResource RoundButtonTemplate}" Background="{StaticResource BlueRadialGradientBrush}" Foreground="#FFFFFF" Width="16" Height="16" FontWeight="Bold" FontSize="{StaticResource SmallTextSize}"
                                Tag="HMC - Ignore Bad Timestamps.png" ToolTipService.ToolTip="Click here for help on Ignore Bad Timestamps" Click="ButtonHelp_Click"/>
                    </StackPanel>

                    <CheckBox Grid.Row="7" Grid.Column="1" Grid.ColumnSpan="2" Content="Perform Timestamp Reasonability Check" IsChecked="{tsfBinding:Column Path=PerformTimestampReasonabilityCheck}" />

                </Grid>           

            </Expander>

            <StackPanel Orientation="Horizontal" Grid.Row="7" Grid.Column="0" HorizontalAlignment="Right">
                <TextBlock Text="Load Order" Style="{StaticResource RequiredLabel}"/>
                <TextBlock Style="{StaticResource RequiredMarker}"/>
            </StackPanel>
            <TextBox Grid.Row="7" Grid.Column="1" Text="{tsfBinding:Column Path=LoadOrder}" Width="35" />

                <TextBlock Grid.Row="7" Grid.Column="2" Text="Stream Mirror Source" Visibility="{Binding Path=DataContext.MirrorMode, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl,AncestorLevel=1}, Converter={StaticResource ObjectToVisibilityConverter}}"/>
                <ComboBox x:Name="ComboBoxMirrorSource" Grid.Row="7" Grid.Column="3" ItemsSource="{Binding Source={StaticResource MirroringSourceLookupList}}" DisplayMemberPath="Value" 
                      SelectedItem="{tsfBinding:Column Path=MirroringSourceDevice, Converter={StaticResource DictionaryToKeyValuePairConverter}, ConverterParameter={StaticResource MirroringSourceLookupList}}" 
                          Visibility="{Binding Path=DataContext.MirrorMode, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl,AncestorLevel=1}, Converter={StaticResource ObjectToVisibilityConverter}}"
                          SelectionChanged="ComboBox_SelectionChanged"/>
                <CheckBox Grid.Row="8" Grid.Column="3" Content="Enabled" IsChecked="{tsfBinding:Column Path=Enabled}"/>
            
            <TextBlock Grid.Row="8" Grid.Column="0" Text="Runtime ID" />
            <StackPanel Orientation="Horizontal" Grid.Row="8" Grid.Column="1">
                    <TextBlock Text="{tsfBinding:Column Path=DataContext.RuntimeID, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl, AncestorLevel=1}}" />
                    <Button Content="Initialize" Command="{Binding Path=DataContext.InitializeCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl, AncestorLevel=1}}" 
                        IsEnabled="{Binding Path=DataContext.IsNewRecord, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl, AncestorLevel=1}, Converter={StaticResource NotConverter}}"/>
                </StackPanel>
            
        </Grid>

        </ScrollViewer>
        
        <uc:DetailViewFooterUserControl x:Name="UserControlDetailViewFooter" DeleteCommand="{Binding DeleteCommand}" ClearCommand="{Binding ClearCommand}" SaveCommand="{Binding SaveCommand}"
                SaveEnabled="{tsfBinding:DataOperation Path=(Validation.HasError)}" />

        <sdk:DataGrid x:Name="DataGridList" ItemsSource="{Binding CurrentPage}" SelectedItem="{Binding Path=CurrentItem, Mode=TwoWay}" PreviewKeyDown="DataGrid_PreviewKeyDown"
                      Sorting="OSGrid_Sorting" SelectedIndex="{tsfBinding:Column Path=CurrentSelectedIndex}" CellEditEnding="DataGrid_CellEditEnding">
            <sdk:DataGrid.Columns>
                <sdk:DataGridTextColumn Header="Acronym" Width="*" Binding="{tsfBinding:Column Path=Acronym}" CellStyle="{StaticResource CenterAlignCellStyle}"/>
                <sdk:DataGridTextColumn Header="Name" Width="*" Binding="{tsfBinding:Column Path=Name}" CellStyle="{StaticResource CenterAlignCellStyle}"/>
                <sdk:DataGridTextColumn Header="Type" Width="*" Binding="{Binding Path=TypeName}" CellStyle="{StaticResource CenterAlignCellStyle}" IsReadOnly="True"/>
                <sdk:DataGridTemplateColumn Header="Enabled" Width="*">
                    <sdk:DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <CheckBox IsChecked="{tsfBinding:Column Path=Enabled}" HorizontalAlignment="Center" Click="DataGridEnabledCheckBox_Click" />
                        </DataTemplate>
                    </sdk:DataGridTemplateColumn.CellTemplate>
                </sdk:DataGridTemplateColumn>
                <!--<sdk:DataGridCheckBoxColumn Header="Enabled" Width="*" Binding="{tsfBinding:Column Path=Enabled}" CellStyle="{StaticResource CenterAlignCellStyle}"/>-->
                <sdk:DataGridTemplateColumn Header="" Width="*">
                    <sdk:DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <Button Template="{StaticResource HyperlinkStyleButtonTemplate}" Content="Devices" Width="Auto"
                                    Command="{tsfBinding:GridButtonCommand Path=DataContext.DeviceCommand}"/>
                        </DataTemplate>
                    </sdk:DataGridTemplateColumn.CellTemplate>
                </sdk:DataGridTemplateColumn>
                <sdk:DataGridTemplateColumn Header="" Width="*">
                    <sdk:DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <Button Template="{StaticResource HyperlinkStyleButtonTemplate}" Content="Measurements" Width="Auto"
                                    Command="{tsfBinding:GridButtonCommand Path=DataContext.MeasurementCommand}">
                                <Button.Visibility>
                                    <Binding Path="DataContext.MirrorMode" RelativeSource="{RelativeSource Mode=FindAncestor, AncestorType=UserControl}" 
                                             Converter="{StaticResource ObjectToVisibilityConverter}">                                        
                                        <Binding.ConverterParameter>
                                            <sys:Boolean>True</sys:Boolean>                                            
                                        </Binding.ConverterParameter>                                        
                                    </Binding>
                                </Button.Visibility>
                            </Button>
                                    
                        </DataTemplate>
                    </sdk:DataGridTemplateColumn.CellTemplate>
                </sdk:DataGridTemplateColumn>
                <sdk:DataGridTemplateColumn Header="" Width="*">
                    <sdk:DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <Button Template="{StaticResource HyperlinkStyleButtonTemplate}" Content="Device Wizard" Width="Auto"
                                    Command="{tsfBinding:GridButtonCommand Path=DataContext.WizardCommand}">
                                <Button.Visibility>
                                    <Binding Path="DataContext.MirrorMode" RelativeSource="{RelativeSource Mode=FindAncestor, AncestorType=UserControl}" 
                                             Converter="{StaticResource ObjectToVisibilityConverter}">
                                        <Binding.ConverterParameter>
                                            <sys:Boolean>True</sys:Boolean>
                                        </Binding.ConverterParameter>
                                    </Binding>
                                </Button.Visibility>
                            </Button>                                    
                        </DataTemplate>
                    </sdk:DataGridTemplateColumn.CellTemplate>
                </sdk:DataGridTemplateColumn>
                <sdk:DataGridTemplateColumn Header="" Width="*">
                    <sdk:DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
                                <Button ToolTip="Update Configuration" Command="{tsfBinding:GridButtonCommand Path=DataContext.UpdateConfigurationCommand}" Width="Auto">
                                    <Image Source="/GSF.TimeSeries.UI;component/images/EditConfiguration.png" Height="16" Width="16" Margin="0,0,5,0"/>
                                </Button>
                                <Button ToolTip="Make Copy" Command="{tsfBinding:GridButtonCommand Path=DataContext.CopyCommand}" CommandParameter="{tsfBinding:GridButtonCommand Path=DataContext.CurrentItem}" Width="Auto">
                                    <Image Source="/GSF.TimeSeries.UI;component/images/Copy.png" Height="16" Width="16" Margin="5,0,0,0"/>
                                </Button>
                            </StackPanel>
                        </DataTemplate>
                    </sdk:DataGridTemplateColumn.CellTemplate>
                </sdk:DataGridTemplateColumn>
            </sdk:DataGrid.Columns>
        </sdk:DataGrid>

        <uc:DataPagerUserControl CurrentPageNumber="{Binding CurrentPageNumber}" PageCount="{Binding PageCount}"
                                FirstCommand="{Binding FirstCommand}" PreviousCommand="{Binding PreviousCommand}"
                                NextCommand="{Binding NextCommand}" LastCommand="{Binding LastCommand}" VerticalAlignment="Bottom"/>

    </StackPanel>
    
</UserControl>
